package com.geek.javase.ch01;

/**
 * @author chenmin
 * @desc TODO
 * @date 2025/9/2
 */
import java.util.Scanner;

public class Switch {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入学员的考试成绩：");
        int score = scanner.nextInt();
        String level;
        // 使用 switch 语句根据成绩范围确定级别
        switch (score / 10) {
            case 10:
                level = "A级";
                break;
            case 9:
                level = "A级";
                break;
            case 8:
                level = "B级";
                break;
            case 7:
                level = "C级";
                break;
            case 6:
                level = "D级";
                break;
            default:
                level = "不合格";
                break;
        }
        System.out.println("该学员考试成绩的级别为：" + level);
        scanner.close();
    }
}
